package com.vegetable.modules.entity.wx;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("wx_approval")
@ApiModel(value="微信审批对象", description="微信审批对象")
public class WXApproval {
    @ApiModelProperty("主键id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    private int id;

    @ApiModelProperty("审批类型：0报销 1付款")
    private Integer approvalType;

    @ApiModelProperty("申请人id")
    private String userId;

    @ApiModelProperty("申请人姓名")
    private String userName;

    @ApiModelProperty("提交申请的时间")
    private Date applyTime;

    @ApiModelProperty("申请单状态：1-审批中；2-已通过；3-已驳回；4-已撤销；6-通过后撤销；7-已删除；10-已支付")
    private String spStatus;

    @ApiModelProperty("审批名称")
    private String spName;

    @ApiModelProperty("审批编号")
    private String spNo;

    @ApiModelProperty("审批金额")
    private BigDecimal money;

    @ApiModelProperty("报销内容")
    private String approvalContent;

    @TableField(exist = false)
    @ApiModelProperty("总金额")
    private BigDecimal totalMoney;

    @ApiModelProperty("完整的审批内容")
    private String spComment;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("报销类型")
    private String reimbursementType;

    @ApiModelProperty("区域ID")
    private Integer regionId;
    
    @ApiModelProperty("付款ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long paymentId;
    
    @ApiModelProperty("打款状态")
    private String paymentStatus;
    
    @ApiModelProperty("打款账户")
    private String paymentAccount;
    
    @ApiModelProperty("打款时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date paymentTime;
}